built-in types
The following table gives the name, size, format, type suffix, and the minimum and maximum
value of every built in data type.
suf | bits | name | format | minimum value | maximum value |
@ | 8 | SBYTE | signed byte integer | -128 | +127 |
@@ | 8 | UBYTE | unsigned byte integer | 0 | +255 |
% | 16 | SSHORT | signed short integer | -32768 | +32767 |
%% | 16 | USHORT | unsigned short integer | 0 | +65535 |
& | 32 | SLONG | signed long integer | -2147483648 | +2147483647 |
&& | 32 | ULONG | unsigned long integer | 0 | +4294967395 |
32/64 | XLONG | natural CPU integer | MIN SLONG/GIANT | MAX SLONG/GIANT | |
32/64 | GOADDR | GOTO address | MIN XLONG | MAX XLONG | |
32/64 | SUBADDR | GOSUB address | MIN XLONG | MAX XLONG | |
32/64 | FUNCADDR | function address | MIN XLONG | MAX XLONG | |
$$ | 64 | GIANT | signed giant integer | -9223372036854775808 | +9223372036854775807 |
! | 32 | SINGLE | IEEE floating point | -1e38 | +1e38 |
# | 64 | DOUBLE | IEEE floating point | -1d308 | +1d308 |
$ | STRING | unsigned byte string | zero characters | 2147483647 characters | |
64 | SCOMPLEX | SINGLE complex | 1e38 : -1e38 | +1e38 : +1e38 | |
128 | DCOMPLEX | DOUBLE complex | 1d308 : -1d308 | +1d308 : +1d308 |
coersion AKA type conversion
Type conversion, also called coercion, is performed automatically when appropriate.
For example, when an operator combines two operands in expression evaluation, the
smaller type is promoted to the larger type before the operation is performed.
A consistent set of intuitive, efficient intrinsics for explicit type conversion are also provided. For all explicit type conversions, the name of the intrinsic is the name of the data type to convert to, as the following table illustrates. The argument can be any built-in simple (numeric) or string type.
SBYTE()
convert to SBYTE
UBYTE() convert to
UBYTE
SSHORT() convert to SSHORT
USHORT() convert to USHORT
SLONG() convert to
SLONG
ULONG() convert to
ULONG
XLONG() convert to
XLONG
GOADDR() convert to GOADDR
SUBADDR() convert to SUBADDR
FUNCADDR() convert to FUNCADDR
GIANT() convert to GIANT
SINGLE() convert to SINGLE
DOUBLE() convert to DOUBLE
STRING() convert to STRING
STRING$() convert to STRING
type sizes
XLONG, GOADDR, SUBADDR, and FUNCADDR data types are 32-bit on some CPUs and 64-bit on
others. These natural integer and address types are 64-bit if the logical address of
the computer CPU is 64-bits. This does not alter how properly written programs
operate. To assure portability, avoid writing programs that depend on the size of
these data types being 32-bits or 64-bits.